/**
 * Copyright (c) 2013-2022 Nikita Koksharov
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.redisson.api;

import java.util.concurrent.CompletionStage;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;


public interface RFuture<V> extends java.util.concurrent.Future<V>, CompletionStage<V> {


    /**
     * 检查异步操作是否成功完成。
     */
    @Deprecated
    boolean isSuccess();

    /**
     * 获取异步操作失败时的异常
     */
    @Deprecated
    Throwable cause();


    /**
     * 如果异步操作已经完成，立即返回结果。
     */
    @Deprecated
    V getNow();


    /**
     * 等待异步操作完成，并返回结果。
     */
    @Deprecated
    V join();



    /**
     * 等待异步操作完成，最多等待指定的时间
     */
    @Deprecated
    boolean await(long timeout, TimeUnit unit) throws InterruptedException;

    /**
     * 等待异步操作完成，最多等待指定的时间（以毫秒为单位）
     */
    @Deprecated
    boolean await(long timeoutMillis) throws InterruptedException;


    /**
     * 等待异步操作完成，并返回未来的操作结果
     */
    @Deprecated
    RFuture<V> sync() throws InterruptedException;


    @Deprecated
    RFuture<V> syncUninterruptibly();

    @Deprecated
    RFuture<V> await() throws InterruptedException;

    @Deprecated
    RFuture<V> awaitUninterruptibly();

    @Deprecated
    boolean awaitUninterruptibly(long timeout, TimeUnit unit);

    @Deprecated
    boolean awaitUninterruptibly(long timeoutMillis);

    @Deprecated
    void onComplete(BiConsumer<? super V, ? super Throwable> action);

}
